package com.devops.constant;

public enum DOSProjectUserTypeEnum {

    CREATE(1,"项目创建者"),
    MANAGER(2,"项目管理者"),
    DEVELOPMENT(3,"项目开发者");

    private Integer type;

    private String value;

    DOSProjectUserTypeEnum(int type, String value) {
        this.type = type;
        this.value = value;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static String getValueByType(Integer type){
        for (DOSProjectUserTypeEnum enums : DOSProjectUserTypeEnum.values()){
            if (enums.type.intValue() == type.intValue()){
                return enums.value;
            }
        }

        return "";
    }

    public static Integer getTypeByValue(String value){
        for (DOSProjectUserTypeEnum enums : DOSProjectUserTypeEnum.values()){
            if (enums.value.equals(value)){
                return enums.type;
            }
        }

        return 0;
    }
}
